<!DOCTYPE html>
<html lang="en">

<head>
    <{include file="header.html" }>
        <title>交易管理-
            <{$user_data[ 'school_name']}>-德安信会计在线教育平台</title>
    <script>
        function change_pay(order_id) {
            if(confirm('确定变更为已付款吗？')){
                $.post('/offline_order/change_order_to_pay/'+order_id,function(res){
                    var json = eval('(' + res + ')'); 
                    if(json.result==0){
                        window.location.href=window.location.href;
                        window.location.reload;
                    }else{
                        alert(json.msg);
                    }
                    
                });
            }
        }
    </script>
</head>

<body>
    <div class="wrap">
        <!--star left-->
        <div class="column">
            <{include file="left_menu.html" }>
        </div>
        <div id="ContMianBox">
            <!--star子栏目-->
            <div class="sub-colum">
                <div class="tit"><{$left_menu_min.menu}></div>
                <ul>
                    <{foreach from=$left_menu_min.list item=item}>
                    <li <{if $item['url'] == $left_menu_min.curr}>class="curr"<{/if}>><a href="<{$item['url']}>"><{$item['name']}></a></li>
                    <{/foreach}>
                </ul>
            </div>
            <!--end子栏目-->
            <!--end left-->
            <div class="container narrow">
                <!--star conter-->
                <div class="cetContent">
                    <div class="tit p-lr20">
                        <span>面授课订单</span>
                    </div>
                    <!--star内容区域-->
                    <div class="mainScroll">
                        <div class="mainContainer line-all">
                            <!--star tabMainCont-->
                            <div class="tabMainCont">
                                <!--star-->
                                <!--end-->
                                <fieldset class="layui-elem-field">
                                    <legend>筛选</legend>
                                    <div class="layui-field-box">
                                        <form class="layui-form layui-form-pane1" method="post" action="/offline_order">
                                            <div class="layui-form-item">
                                                <div class="layui-inline">
                                                    <input type="text" name="order_num" placeholder="订单号" autocomplete="off" class="layui-input" value='<{if $data['order_num'] != 0}><{$data['order_num']}><{/if}>'>
                                                </div>
                                                <div class="layui-inline">
                                                    <input type="text" name="mobile" placeholder="学员手机号" autocomplete="off" class="layui-input" value='<{if $data['mobile'] != 0}><{$data['mobile']}><{/if}>'>
                                                </div>
                                                <div class="layui-inline">
                                                    <select name="school_campus_id">
                                                        <option value="" >校区筛选</option>
                                                        <{foreach from=$campus_list item=item}>
                                                            <option value="<{$item.id}>" <{if isset($data.school_campus_id) && $item.id==$data.school_campus_id}>selected=selected<{/if}>><{$item.name}></option>
                                                        <{/foreach}>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <div class="layui-inline">
                                                    <input type="text" name="st" placeholder="开始日"  class="layui-input" value='<{if $data['st'] != 0}><{$data['st']}><{/if}>' id="LAY_demorange_s">
                                                </div>
                                                <div class="layui-inline">
                                                    <input type="text" name="et" placeholder="截止日"  class="layui-input" value='<{if $data['et'] != 0}><{$data['et']}><{/if}>' id="LAY_demorange_e">
                                                </div>
                                                <div class="layui-inline">
                                                    <button type="submit" class="layui-btn">搜索</button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </fieldset>
                            </div>
                            <!--商品列表 star-->
                            <div class="goods_list p-t10">
                                <div class="mtc_tab">
                                    <!--star mt-->
                                    <div class="mt">
                                        <a href="/offline_order/index/all/<{$data.school_campus_id}>/<{$data.order_num}>/<{$data.order_num}>/<{$data.st}>/<{$data.et}>/<{$data.mobile}>" <{if $data.status == 'all'}>class="curr"<{/if}>>全部订单</a>
                                        <a href="/offline_order/index/-1/<{$data.school_campus_id}>/<{$data.order_num}>/<{$data.st}>/<{$data.et}>/<{$data.mobile}>" <{if $data.status == -1}>class="curr"<{/if}>>取消</a>
                                        <a href="/offline_order/index/0/<{$data.school_campus_id}>/<{$data.order_num}>/<{$data.st}>/<{$data.et}>/<{$data.mobile}>" <{if $data.status == '0'}>class="curr"<{/if}>>待支付</a>
                                        <a href="/offline_order/index/1/<{$data.school_campus_id}>/<{$data.order_num}>/<{$data.st}>/<{$data.et}>/<{$data.mobile}>" <{if $data.status == 1}>class="curr"<{/if}>>已支付</a>
                                        <a href="/offline_order/index/2/<{$data.school_campus_id}>/<{$data.order_num}>/<{$data.st}>/<{$data.et}>/<{$data.mobile}>" <{if $data.status == 2}>class="curr"<{/if}>>已发货</a>
                                    
                                    </div>
                                    <!--end mt-->
                                    <!--star mc-->
                                    <div class="mc">
                                        <div class="u_table_list m-t20" style="margin-top:10px;">
                                            <!--star 名称-->
                                            <div class="mtt line-left line-right line-top">
                                                <table>
                                                    <colgroup>
                                                        <col width="35%">
                                                        <col width="15%">
                                                        
                                                        
                                                        <col width="10%">
                                                        <col width="15%">
                                                    </colgroup>
                                                    <tbody>
                                                        <tr class="fwb">
                                                            <th>课程</th>
                                                            
                                                            
                                                            <th>学员信息</th>
                                                            <th>校区</th>
                                                            <th>&nbsp;</th>
                                                        </tr>
                                                    </tbody>
                                                </table>
                                            </div>
                                            <!--end 名称-->
                                            <!--star 商品-->
                                            <{foreach from=$order item=item}>
                                                <div class="table002 line-right line-top m-t20" style="margin-top:10px;">
                                                    <table>
                                                        <colgroup>
                                                            <col width="%">
                                                            <col width="%">
                                                            <col width="%">
                                                            <col width="%">
                                                        </colgroup>
                                                        <tbody>
                                                            <tr>
                                                                <td class="tb_top" colspan="4"><span>订单号: <{$item['order_num']}></span><span class="p-l50 c-FF0000"></span><span class="r">下单时间: <{$item['order_time']|date_format:'%Y-%m-%d %H:%M:%S'}></span></td>
                                                            </tr>
                                                        </tbody>
                                                        <tbody>
                                                            <tr>
                                                                <td>
                                                        <table class="not_lb">
                                                            <{foreach from=$item['order_products']|json_decode item=oitem}>
                                                                <tr class="not_lb">
                                                                 <td >
                                                                    <div class="product_name">
                                                                        <div class="t_img"><img src="<{$oitem->course_img}>" /></div>
                                                                        <div class="t_info">
                                                                            <a href="javascript:;"><{$oitem->title}></a>
                                                                            <div>
                                                                            
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </td>
                                                               
                                                                </tr>
                                                                <{/foreach}>
                                                            </table>
                                                                    </td>
                                                                    <td class="tac">
                                                                    <span class=""><{$item['buyer_user_name']}></span>
                                                                        <span class="c-3b9eeb"><{$item['buyer_user_phone']}></span>
                                                                    </td>
                                                                    <td>
                                                                        <{$item[ 'campus_name']}>
                                                                    </td>
                                                                    <td class="tac">

                                                                    <{if $item[ 'order_status']==0}>
                                                                        未付款<br/>
                                                                        <a class="c-3b9eeb" onclick="change_pay(<{$item['order_id']}>)" href="javascript:;">变更为已付款</a><br>
                                                                        <a class="c-3b9eeb" href="/orders/del/<{$item['order_id']}>">删除订单</a>
                                                                        <{elseif $item[ 'order_status']==1}>
                                                                            已付款
                                                                            <a class="c-3b9eeb" href="/student/subject_list/<{$item['student_id']}>">去安排班级</a>
                                                                         <{elseif $item[ 'order_status']==2}>
                                                                         已处理
                                                                    <{/if}>


                                                                    </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </div>
                                                <{/foreach}>
                                                    <!--end 商品-->
                                        </div>
                                        <div class="pages" style="padding:20px; text-align:right;">
                                            <{$pagination}>
                                        </div>
                                    </div>
                                    <!--end mc-->
                                </div>
                            </div>
                            <!--商品列表 end -->
                        </div>
                        <!--end tabMainCont-->
                    </div>
                </div>
            </div>
            <!--end内容区域-->
            <!--end conter-->
        </div>
        <{include file="footer.html"}>
        <script>
        $(function() {
            $.fn.Dashentab(".cetContent .tit", "span", ".tabMainCont", ".tabItem", "curr", "click", 0);
            $(".sub-colum").find('li').on('click', function() { //子栏目点击选中状态；
                $(this).addClass('curr').siblings().removeClass('curr');
            })
        });
        </script>
        <script>
        layui.use('laydate', function() {
            var laydate = layui.laydate;

            var start = {
                min: '2016-11-31 23:59:59',
                max: laydate.now(+1),
                istoday: false,
                choose: function(datas) {
                    end.min = datas; //开始日选好后，重置结束日的最小日期
                    end.start = datas //将结束日的初始值设定为开始日
                }
            };

            var end = {
                min: '2016-11-31 23:59:59',
                max: laydate.now(+1),
                istoday: false,
                choose: function(datas) {
                    start.max = datas; //结束日选好后，重置开始日的最大日期
                }
            };

            document.getElementById('LAY_demorange_s').onclick = function() {
                start.elem = this;
                laydate(start);
            }
            document.getElementById('LAY_demorange_e').onclick = function() {
                end.elem = this
                laydate(end);
            }

        });
        </script>
    </div>
    </div>
</body>

</html>
